import request from '@/utils/request'

// 查询流程单列表
export function listForm(query) {
  return request({
    url: '/flowable/flowableForm/list',
    method: 'get',
    params: query
  })
}

// 查询流程单详细
export function getForm(formId) {
  return request({
    url: '/flowable/flowableForm/' + formId,
    method: 'get'
  })
}

export function getFormByKey(formkey) {
  return request({
    url: '/flowable/flowableForm/getInfoByKey/' + formkey,
    method: 'get'
  })
}

// 新增流程单
export function addForm(data) {
  return request({
    url: '/flowable/flowableForm',
    method: 'post',
    data: data
  })
}

// 修改流程单
export function updateForm(data) {
  return request({
    url: '/flowable/flowableForm',
    method: 'put',
    data: data
  })
}

// 删除流程单
export function delForm(formId) {
  return request({
    url: '/flowable/flowableForm/' + formId,
    method: 'delete'
  })
}

// 导出流程单
export function exportForm(query) {
  return request({
    url: '/flowable/flowableForm/export',
    method: 'get',
    params: query
  })
}